]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
WorkspacesView: don't access the allocation 4 times
authorGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 8 May 2014 17:17:26 +0000 (19:17 +0200)
committerGiovanni Campagna <gcampagna@src.gnome.org>
Thu, 26 Jun 2014 17:20:17 +0000 (19:20 +0200)
Access it once, and save 3 GObject property accesses and related
copies.

https://bugzilla.gnome.org/show_bug.cgi?id=729823

js/ui/workspacesView.js

index 3dfbe1e9b940695182d895a9feee568efefb4164..61df6ab9630373caad583acd1377256aea8a46a1 100644 (file)
@@ -606,8 +606,9 @@ const WorkspacesDisplay = new Lang.Class({
             return;
 
         let [x, y] = this.actor.get_transformed_position();
-        let width = this.actor.allocation.x2 - this.actor.allocation.x1;
-        let height = this.actor.allocation.y2 - this.actor.allocation.y1;
+        let allocation = this.actor.allocation;
+        let width = allocation.x2 - allocation.x1;
+        let height = allocation.y2 - allocation.y1;
         let primaryGeometry = { x: x, y: y, width: width, height: height };
 
         let monitors = Main.layoutManager.monitors;